package com.kws.merchant.service.impl;


import com.kws.merchant.domain.ItemScheme;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kws.merchant.mapper.ItemSchemeMapper;
import com.kws.merchant.service.ItemSchemeService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;

import java.util.List;

/**
 * 报价-项目子方案(ItemScheme)表服务实现类
 *
 * @author yxy
 * @since 2024-10-24 15:55:40
 */
@Service("itemSchemeService")
public class ItemSchemeServiceImpl extends ServiceImpl<ItemSchemeMapper, ItemScheme> implements ItemSchemeService {

    @Resource
    private ItemSchemeMapper itemSchemeMapper;


    /**
     * 分页查询列表
     */
    @Override
    public Page<ItemScheme> pageList(ItemScheme itemScheme) {
        Page<ItemScheme> page = new Page<>(0, 10);
        LambdaQueryWrapper<ItemScheme> queryWrapper = Wrappers.lambdaQuery();

        return this.page(page, queryWrapper);
    }

    /**
     * 根据方案id查询报价明细
     * @return
     */
    @Override
    public List<ItemScheme> listByItemId(Long schemeId,Long merchantId) {
        return this.list(Wrappers.<ItemScheme>lambdaQuery().eq(ItemScheme::getSchemeId,schemeId).eq(ItemScheme::getMerchantId,merchantId));
    }


}
